Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum


  

PreviousPrevious NextNext

RE: How to refresh field using script - back end processing
~Umberto Nongeroson 20.Jan.04 03:42 PM a Web browser
Applications Development 6.0.2 CF2 Windows XP


Your script doesn't make any sense. First you obtain a back end document, then you obtain the front end document, refresh it, save it, then compute the form on the back end document.

Set NowDoc = ListView.GetFirstDocument()
While Not NowDoc Is Nothing
Set uidoc = workspace.CurrentDocument
Call uidoc.Refresh
Call uidoc.Save
Call NowDoc.ComputeWithForm(True, False)
Call NowDoc.Save(True, True)
Set NowDoc = ListView.GetNextDocument(NowDoc)
Wend

A script to compute the form on all the documents in a folder would look like this:

dim s as notessession
dim db as notesdatabase, folder as notesview, d as notesdocument, flag as integer

set s = notessession
set db = s.currentdatabase
set folder = db.getview("foo")
set d = folder.getfirstdocument
do while not (d is nothing)
flag = d.computewithform(false,false)
if flag then
call d.save(false,false)
else
' hande this error here
end if
set d = folder.getnextdocument(d)
loop

Be advised that computewithform is a very resource intensive method. If you need to run it on a lrge number of documents you should create a simplified copy of your form, one that contains just those fields that need to be recomputed, and then do this:

do while not (d is nothing)
d.Form="SimplifiedForm"
flag = d.computewithform(false,false)
if flag then
d.Form="TheRealForm"
call d.save(false,false)
else
' hande this error here
end if
set d = folder.getnextdocument(d)
loop

If that's still too processor intensive you should stop using computewithform and do the job with script alone.




How to refresh field using script -... (~Kirk Brefreevi... 20.Jan.04)
. . RE: How to refresh field using scri... (~Dan Ekgeropul 20.Jan.04)
. . RE: How to refresh field using scri... (~Wei Frojipyman... 20.Jan.04)


Document Options






  Document options
Print this pagePrint this page

Search this forum

Forum views and search


  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Category
Platform
Release
Advanced search

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS